package com.cy.store.configuer;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 映射本地路径 "file:D:/.IdeaProject/self-developed/store/upload/" 到 Web 路径 "/upload/**"
        registry.addResourceHandler("/upload/**")
                .addResourceLocations("file:D:/.IdeaProject/self-developed/store/upload/");
    }
}